<script setup>
  import {ref} from "vue";

  //响应式
  let count = ref( 0);
  let elem = ref();

  setTimeout(()=>{
    count.value ++;

    //获取到对应dom节点对象
    console.log(elem.value);
  },2000)
</script>

<template>
  <div>
    <h2 ref="elem">setup方法</h2>
    {{ count }}
  </div>
</template>

<style lang="scss" scoped>

</style>